package Book;

public class book {
    protected String name;
    protected String author;
    protected String type;
    protected boolean IsBorrowed;

    // 可以不用对IsBorrowed 初始化
    public book(String name, String author, String type) {
        this.name = name;
        this.author = author;
        this.type = type;
    }

    public boolean isBorrowed() {
        return IsBorrowed;
    }

    public void setBorrowed(boolean borrowed) {
        IsBorrowed = borrowed;
    }

    public String getName() {
        return name;
    }

    // 重写toString方法 打印书籍详细信息
    @Override
    public String toString() {
        return "BookList{" +
                "name='" + name + '\'' +
                ", author='" + author + '\'' +
                ", type='" + type + '\'' +
                ((IsBorrowed)?" 借出":"  未借出") +
                '}';
    }
}
